﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wp.BLL;
using TagCloud;

public partial class Controls_Tags : System.Web.UI.UserControl
{
    public string Taxonomy = "posttags";
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            List<Tag> ls = TblTermTaxonomyManager.CreateInstant().SelectTagTopCount(Taxonomy, 20);
            TagCloud.TagCloud tc = new TagCloud.TagCloud(ls, new TagCloudGenerationRules
            {
                //TagToolTipFormatString = "Tag weight: {0}",
                TagUrlFormatString = "/tag/{0}.html"
            });

            LiteralTag.Text = tc.ToString();
        }
    }
}